package com.yuandian.api.management.entity;

import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.time.LocalDateTime;
import java.util.List;


/**
 * 返回码配置表-实体
 * @author zfsn
 * @date 2023-3-28
 */
@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "返回码配置表", description = "")
@TableName("conf_return_code")
public class ConfReturnCode extends BasePage<ConfReturnCode> {

	/**
	 * 主键，唯一标识数据
	 */
	@ApiModelProperty(value = "主键", notes = "主键，唯一标识数据")
	@TableId(type = IdType.AUTO)
	private Integer id;

	/**
	 * 返回码类型id，对应字典类型：return_code_type
	 */
	@ApiModelProperty(value = "返回码类型id", notes = "返回码类型id，对应字典类型：return_code_type")
	private Integer typeId;



	/**
	 * 返回码名称
	 */
	@ApiModelProperty(value = "返回码名称", notes = "返回码名称")
	@TableField("`name`")
	private String name;

	/**
	 * 返回值
	 */
	@ApiModelProperty(value = "返回值", notes = "返回值")
	@TableField("`value`")
	private String value;

	/**
	 * 说明
	 */
	@ApiModelProperty(value = "说明", notes = "说明")
	@TableField("`explain`")
	private String explain;

	/**
	 * 0:异常，1:正常
	 */
	@ApiModelProperty(value = "状态", notes = "0:异常，1:正常")
	private Integer status;

	/**
	 * 状态级别
	 */
	@ApiModelProperty(value = "状态级别", notes = "状态级别")
	@TableField("`level`")
	private Integer level;

	/**
	 * 显示顺序
	 */
	@JsonIgnore
	@ApiModelProperty(value = "显示顺序", notes = "显示顺序")
	private Integer sequence;

	/**
	 * 创建人
	 */
	@JsonIgnore
	@ApiModelProperty(value = "创建人", notes = "创建人")
	private String createBy;

	/**
	 * 创建时间
	 */
	@JsonIgnore
	@ApiModelProperty(value = "创建时间", notes = "创建时间")
	private LocalDateTime createTime;

	/**
	 * 更新人
	 */
	@JsonIgnore
	@ApiModelProperty(value = "更新人", notes = "更新人")
	private String updateBy;

	/**
	 * 更新时间
	 */
	@JsonIgnore
	@ApiModelProperty(value = "更新时间", notes = "更新时间")
	private LocalDateTime updateTime;

	/**
	 * 是否逻辑删除，0：否、1：是
	 */
	@JsonIgnore
	@ApiModelProperty(value = "是否逻辑删除", notes = "是否逻辑删除，0：否、1：是")
	private Integer isDel;

	/**
	 * 备注
	 */
	@JsonIgnore
	@ApiModelProperty(value = "备注", notes = "备注")
	private String remarks;

	/**
	 * 返回码名称和值：用于作 map 的key值
	 */
	@TableField(exist = false)
	private String nameAndValue;

	public void setNameAndValue(String nameAndValue) {
		this.nameAndValue = name +"@"+ value;
	}

	/**
	 * 返回码类型名称
	 */
	@TableField(exist = false)
	private String typeName;

	/**
	 * 返回码数量
	 */
	@TableField(exist = false)
	private int codeCount;

	/**
	 * 主键列表
	 */
	@TableField(exist = false)
	private List<Integer> ids;
}



